<%@ page import="com.stand.hardcode.entity.StandUser, com.stand.hardcode.util.RequestAttributes" %>
<%



%>
<html>
<h1>Admin panel</h1>

Grant admin rights to: 
<form method="POST" action="grantadmin">
<input type="text" name="<%=RequestAttributes.SEARCH_EMAIL %>" /> <br />
<input type="submit" value="grant" />
</form>
<%if(request.getAttribute(RequestAttributes.ADMIN_GRANTED) != null){
%>
<%=request.getAttribute(RequestAttributes.ADMIN_GRANTED)%> <br />
<% } %>
<h2>Manage users</h2>
Search: <br />
email: <form method="POST" action="adminpanel"> <input type="text" name="<%=RequestAttributes.SEARCH_EMAIL %>" /> <input type="submit" value="search" /></form>

<% if (request.getAttribute(RequestAttributes.HAS_SEARCH_RESULTS) !=null && request.getAttribute(RequestAttributes.HAS_SEARCH_RESULTS).equals(RequestAttributes.YES)) {
%>
Email: <%=request.getAttribute(RequestAttributes.SEARCH_EMAIL) %> <br/>
Nickname: <%=request.getAttribute(RequestAttributes.SEARCH_NICKNAME) %>
Status: <%=request.getAttribute(RequestAttributes.SEARCH_ACTIVE_STATUS) %> <br />

<form method="POST" action="adminactivation">

<input type="submit" value="Reactivate / Deactivate" />
</form>

<%
request.getSession().setAttribute(RequestAttributes.SEARCH_EMAIL, request.getAttribute(RequestAttributes.SEARCH_EMAIL));
}
%>
</html>